package com.itheima.genericityclass.employ;

import java.util.ArrayList;

public class EmployTest {
    public static void main(String[] args) {
        show(new ArrayList<Person>());
        show(new ArrayList<Employ>());
        show(new ArrayList<Manager>());
        show(new ArrayList<Code>());
        System.out.println("-----------");
        //show1(new ArrayList<Person>());
        show1(new ArrayList<Employ>());
        show1(new ArrayList<Manager>());
        show1(new ArrayList<Code>());
        System.out.println("-----------");
        show2(new ArrayList<Person>());
        show2(new ArrayList<Employ>());
        /*show2(new ArrayList<Manager>());
        show2(new ArrayList<Code>());*/
        System.out.println("-----------");
    }
//    ? 可以匹配任意类型
    private static void show(ArrayList<?> employs) {
    }
//    ? extend 向下匹配,上限是自己
    private static void show1(ArrayList<? extends Employ> employs) {
    }
//    ? super 向上匹配,下限是自己
    private static void show2(ArrayList<? super Employ> employs) {
    }
}

class Person{}

class Employ extends Person{}

class Manager extends Employ{}
class Code extends Employ{}
